package com.readpost.doman.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
//文章分类
public class ArticleCategories {

    // 分类ID
    @NotNull(message = "分类ID不能为空" , groups = Update.class)
    private Integer categoryId;

    // 分类名称
    @NotNull(message = "分类名称不能为空", groups = {Update.class ,Add.class})
    private String categoryName;

    // 分类描述
    private String description;

    // 父分类ID
    private Integer parentCategoryId;

    // 是否启用
    private boolean isActive;

    // 排序顺序
    private int sortOrder;

//    //修改人
//    private String modifiedUser;

    // 创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    // 更新时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    public  interface Update extends Default {}

    public  interface Add extends Default {}
}
